/* === Lists === */
@import "../variables.less";
@import "../mixins.less";

@border-color: @color-split;
.list {
  margin: 1rem 0;
  font-size: 0.85rem;

  ul {
    .hairline(top, @border-color);
    .hairline(bottom, @border-color);
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
  }

  .list-title, .list-append {
    font-size: .8rem;
    color: @color-text-gray;
    padding: .2rem .75rem;
  }

  .list-append {
    padding: .3rem .75rem;
    font-size: .7rem;
  }

  li + li {
    .item-content {
      .hairline(top, @border-color);
    }
  }

  .item-inner {
    width: 100%;
    display: flex;
    padding: 0 0 0 .75rem;
    position: relative;
  }

  .item-media {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .25rem 0;
  }

  .item-content {
    width: 100%;
    position: relative;
    padding: .4rem .75rem .4rem 0;
  }

  .item-link .item-content {
    padding-right: 1.4rem;
  }

  .item-link .link-arrow {
    font-size: .7rem;
    position: absolute;
    right: .3rem;
    top: 50%;
    height: 1rem;
    width: .8rem;
    color: #c7c7c7;
    margin-top: -.5rem;
  }

  .item-media + .item-content {
    margin-left: .75rem;
  }

  .item-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .label-switch {
    display: block;
  }

  .item-after {
    margin-left: .5rem;
    color: @color-text-gray;
    flex-shrink: 1;
  }

  .item-subtitle {
    font-size: .75rem;
  }

  .item-text {
    color: @color-text-secondary;
    font-size: .75rem;
  }

  .list-group-title {
    padding: 0 15px;
    background: #f7f7f7;
    color: #000;
    font-weight: 500;
    line-height: 1.1rem;
    height: 1.1rem;

    + li .item-content {
      .hairline-remove(top);
    }
  }

  .item-after .badge {
    vertical-align: .1rem;
  }
}

// Checkboxes
label.label-checkbox {
  cursor: pointer;
  .item-content {
    padding-right: 2rem;
  }
  i.icon-form-checkbox {
    width: 22px;
    height: 22px;
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translate3d(0, -50%, 0);
    border-radius: 22px;
    border: 1px solid #c7c7cc;
    box-sizing: border-box;

    &:after {
      content:' ';
      position: absolute;
      left: 50%;
      margin-left: -6px;
      top: 50%;
      margin-top: -4px;
      width: 12px;
      height: 9px;
    }
  }
  input[type="checkbox"] {
    display: none;
    &:checked {
      ~ i.icon-form-checkbox {
        border: none;
        background-color: @color-primary;
      }
      ~ i.icon-form-checkbox:after {
        background: no-repeat center;
        .encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 12 9' xml:space='preserve'><polygon fill='#ffffff' points='12,0.7 11.3,0 3.9,7.4 0.7,4.2 0,4.9 3.9,8.8 3.9,8.8 3.9,8.8 '/></svg>");
        -webkit-background-size: 12px 9px;
        background-size: 12px 9px;
      }
    }
  }
}
label.label-radio {
  cursor: pointer;
  input[type="checkbox"], input[type="radio"] {
    display: none;
    ~ .item-content {
      padding-right: 2rem;
    }
    &:checked ~ .icon-form-radio{
      content: " ";
      background: no-repeat center;
      .encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 10'><polygon fill='@{color-primary}' points='11.6,0 4.4,7.2 1.4,4.2 0,5.6 4.4,10 4.4,10 4.4,10 13,1.4 '/></svg>");
      background-position: center;
      background-size: 15px 11px;
      width: 2rem;
      height: 100%;
      position: absolute;
      top: 0;
      right: 0;
    }
  }
}
label.label-checkbox, label.label-radio, .item-link {
  transition: 300ms;
  &:active {
    transition: 0ms;
    background-color: #d9d9d9;
    .item-content {
      .hairline-color(bottom, transparent);
    }
  }
}
